﻿namespace Pathfinder.Base.Constructs
{
    using System;

    /// <summary>
    /// Class enumerates the information for a specific type of AC Modifier.
    /// </summary>
    [AttributeUsage(AttributeTargets.Field)]
    [Serializable]
    public class ACTypeEffectAttribute : Attribute
    {
        /// <summary>
        /// Default constructor.
        /// </summary>
        public ACTypeEffectAttribute()
        {
        }

        /// <summary>
        /// Constructor for AC Attribute with specific effects.
        /// </summary>
        /// <param name="effectsFlatFooted">If true, effects flat footed AC.</param>
        public ACTypeEffectAttribute(bool effectsFlatFooted)
        {
            mEffectsFlatFooted = effectsFlatFooted;
        }

        /// <summary>
        /// Constructor for AC Attribute with specific effects.
        /// </summary>
        /// <param name="effectsFlatFooted">If true, effects flat footed AC.</param>
        /// <param name="effectsTouch">If true, effects touch AC.</param>
        public ACTypeEffectAttribute(bool effectsFlatFooted, bool effectsTouch)
            : this(effectsFlatFooted)
        {
            mEffectsTouch = effectsTouch;
        }

        /// <summary>
        /// Constructor for AC Attribute with specific effects.
        /// </summary>
        /// <param name="effectsFlatFooted">If true, effects flat footed AC.</param>
        /// <param name="effectsTouch">If true, effects touch AC.</param>
        /// <param name="dependent">If true, should not be enumerated in the token since it's dependent on another automatic mod.</param>
        public ACTypeEffectAttribute(bool effectsFlatFooted, bool effectsTouch, bool dependent)
            : this(effectsFlatFooted, effectsTouch)
        {
            mDependent = dependent;
        }

        /// <summary>
        /// Constructor for AC Attribute with specific effects.
        /// </summary>
        /// <param name="effectsFlatFooted">If true, effects flat footed AC.</param>
        /// <param name="effectsTouch">If true, effects touch AC.</param>
        /// <param name="dependent">If true, should not be enumerated in the token since it's dependent on another automatic mod.</param>
        /// <param name="alternateNames">Alterate names this ac mod is referred to.</param>
        public ACTypeEffectAttribute(bool effectsFlatFooted, bool effectsTouch, bool dependent, string alternateNames)
            : this(effectsFlatFooted, effectsTouch, dependent)
        {
            mAlternameNames = alternateNames;
        }

        /// <summary>
        /// Gets if this AC Mod effects Flat Footed AC.
        /// </summary>
        public bool EffectsFlatFooted
        {
            get { return mEffectsFlatFooted; }
        }

        /// <summary>
        /// Gets if this AC Mod effects Touch AC.
        /// </summary>
        public bool EffectsTouch
        {
            get { return mEffectsTouch; }
        }

        /// <summary>
        /// Gets the alternate names of an AC type.
        /// </summary>
        public string AlternateNames
        {
            get { return mAlternameNames; }
        }

        /// <summary>
        /// Gets if this is dependent on an automatically tracked mod.
        /// </summary>
        public bool Dependent
        {
            get { return mDependent; }
        }

        private bool mEffectsFlatFooted = false;
        private bool mEffectsTouch = false;
        private bool mDependent = false;
        public string mAlternameNames = null;
    }
}
